; ----------------------------------------------------------------------------
; hello.asm
;
; Writes "Hello, World" to the console using only system calls.
;
; Assembler: NASM
; OS: Linux x86
; Assemble with "nasm -felf hello.asm"
; ----------------------------------------------------------------------------

section .text
_start:
        ; write(1, message, 13)
        mov     ecx, ebp
        add     ecx, 17                 ; address of string to output

        xor     eax, eax                ; eax = 0
        add     eax, 4                  ; system call 4 is write

        xor     ebx, ebx                ; ebx = 0
        add     ebx, 1                  ; file handle 1 is stdout

        xor     edx, edx
        add     edx, 13                 ; number of bytes

        int     80h
        ret

message:
        db      "Hello, World", 10


